#ifndef __M_MESSAGE__
#define __M_MESSAGE__
/*
    定义日志消息类，进行日志中间消息的存储
    1.日志输出时间
    2.日志等级
    3.源文件名称
    4.源代码行号
    5.线程ID
    6.日志主体消息
    7.日志器名称
*/

#include <iostream>
#include <ctime>
#include <string>
#include <thread>

#include "level.hpp"
#include "Util.hpp"

namespace bin
{
    class LogMsg
    {
    public:
        LogMsg(LogLevel::value level, size_t line, const std::string& file, const std::string& logger, const std::string& msg)
        :_ctime(util::Date::now())
        ,_level(level)
        ,_line(line)
        ,_id(std::this_thread::get_id())
        ,_file(file)
        ,_payload(msg)
        ,_logger(logger)
        {}

    public:
        time_t _ctime;
        LogLevel::value _level;
        std::string _file;
        size_t _line;
        std::thread::id _id;
        std::string _payload;
        std::string _logger;
    };
}

#endif